<script setup lang="ts">
import { onMounted, reactive, ref } from 'vue'
import formTitle from './formTitle.vue'
import { loadEnv } from '@build/index'

import { useI18n } from 'vue-i18n'
const { t } = useI18n()

const emits = defineEmits(['switchForm'])
const clickDiffFormBtn = (formName: string) => {
  emits('switchForm', formName)
}
const { VITE_Redirect_Uri } = loadEnv()

onMounted(() => {  
  let url = `${VITE_Redirect_Uri}/ams/api/wecom/qrcode`

  new window.WwLogin({
    "id": "qr_login",
    "appid": "wwce43b50f723f7ec6",
    "agentid": 1000025,
    "redirect_uri": encodeURI(url),
    "state": "hello",
    "href": "",
    "lang": "zh"
  })
});

</script>

<template>
  <div class="login-wrapper">    
    <div class="qr-box">
      <div class="qr_login" id="qr_login"></div>
    </div>    
    <div class="bottom-btns">
      <a-button @click="clickDiffFormBtn('loginForm')">{{
        t('system.login.backSignIn')
      }}</a-button>
    </div>
  </div>
</template>

<style lang="less" scoped>
@import '../../../style/login.less';

.qr-box {
  height: 24rem;  
  margin-left: 1.24rem;
  @media (min-width: 1170px) {
      margin-left: 3.24rem;
    } 
}
</style>
<style lang="less">
html[data-theme='dark'] {
  .login-wrapper {
    .ant-divider-inner-text {
      color: #8b949e !important;
    }
  }
}
</style>

<style>

</style>
